#ifndef V2_NIM_MESSAGE_SERVICE_H
#define V2_NIM_MESSAGE_SERVICE_H
#include "v2_nim_internal.hpp"
namespace v2 {
/// @brief 消息服务
/// @pre
/// 调用 `V2NIMClient::get()` 拿到 client 实例
/// 调用 `client.getMessageService()` 拿到 messageService 实例
/// @par 示例代码
/// @code
/// auto& client = V2NIMClient::get();
/// auto& messageService = client.getMessageService();
/// @endcode
class V2NIMMessageService {
public:
    /// @brief 发送消息
    /// @param message 要发送的消息
    /// @param conversationId 发送目标会话
    /// @param params 发送参数
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @param progress 附件上传进度回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// auto conversationId = V2NIMConversationIdUtil::p2pConversationId("target_account_id");
    /// auto message = V2NIMMessageCreator::createTextMessage("hello world");
    /// auto params = V2NIMSendMessageParams();
    /// messageService.sendMessage(
    ///     message,
    ///     conversationId,
    ///     params,
    ///     [](V2NIMSendMessageResult result) {
    ///         // send message succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // send message failed, handle error
    ///     },
    ///     [](uint32_t progress) {
    ///         // upload progress
    ///     });
    /// @endcode
    virtual void sendMessage(V2NIMMessage message,
        nstd::string conversationId,
        V2NIMSendMessageParams params,
        V2NIMSuccessCallback<V2NIMSendMessageResult> success,
        V2NIMFailureCallback failure,
        V2NIMProgressCallback progress) = 0;

    /// @brief 回复消息
    /// @param message 要发送的消息
    /// @param replyMessage 被回复的消息
    /// @param params 发送参数
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @param progress 附件上传进度回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// auto message = V2NIMMessageCreator::createTextMessage("hello world");
    /// auto params = V2NIMSendMessageParams();
    /// messageService.replyMessage(
    ///     message,
    ///     replyMessage,
    ///     params,
    ///     [](V2NIMSendMessageResult result) {
    ///         // reply message succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // reply message failed, handle error
    ///     },
    ///     [](uint32_t progress) {
    ///         // upload progress
    ///     });
    /// @endcode
    virtual void replyMessage(V2NIMMessage message,
        V2NIMMessage replyMessage,
        V2NIMSendMessageParams params,
        V2NIMSuccessCallback<V2NIMSendMessageResult> success,
        V2NIMFailureCallback failure,
        V2NIMProgressCallback progress) = 0;

    /// @brief 撤回消息
    /// @param message 要撤回的消息
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMMessage message;
    /// // ...
    /// V2NIMMessageRevokeParams params;
    /// messageService.revokeMessage(
    ///     message,
    ///     params,
    ///     []() {
    ///         // revoke message succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // revoke message failed, handle error
    ///     });
    /// @endcode
    virtual void revokeMessage(V2NIMMessage message,
        V2NIMMessageRevokeParams params,
        V2NIMSuccessCallback<void> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 查询消息
    /// @param option 查询消息配置选项
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMMessageListOption option;
    /// option.limit = 10;
    /// messageService.getMessageList(
    ///     option,
    ///     [](nstd::vector<V2NIMMessage> messages) {
    ///         for (auto&& message : messages) {
    ///             // do something
    ///         }
    ///     },
    ///     [](V2NIMError error) {
    ///         // get message list failed, handle error
    ///     });
    /// @endcode
    virtual void getMessageList(V2NIMMessageListOption option,
        V2NIMSuccessCallback<nstd::vector<V2NIMMessage>> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 根据 ID 列表查询消息
    /// @param messageClientIds 消息客户端 ID 列表
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// nstd::vector<nstd::string> messageClientIds;
    /// // ...
    /// messageService.getMessageListByIds(
    ///     messageClientIds,
    ///     [](nstd::vector<V2NIMMessage> messages) {
    ///         for (auto&& message : messages) {
    ///             // do something
    ///         }
    ///     },
    ///     [](V2NIMError error) {
    ///         // get message list by ids failed, handle error
    ///     });
    /// @endcode
    virtual void getMessageListByIds(nstd::vector<nstd::string> messageClientIds,
        V2NIMSuccessCallback<nstd::vector<V2NIMMessage>> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 根据消息引用列表查询消息
    /// @param messageRefers 消息引用列表
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// nstd::vector<V2NIMMessageRefer> messageRefers;
    /// // ...
    /// messageService.getMessageListByRefers(
    ///     messageRefers,
    ///     [](nstd::vector<V2NIMMessage> messages) {
    ///         for (auto&& message : messages) {
    ///             // do something
    ///         }
    ///     },
    ///     [](V2NIMError error) {
    ///         // get message list by refers failed, handle error
    ///     });
    /// @endcode
    virtual void getMessageListByRefers(nstd::vector<V2NIMMessageRefer> messageRefers,
        V2NIMSuccessCallback<nstd::vector<V2NIMMessage>> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 查询 thread 聊天云端消息列表
    /// @param V2NIMTheadMessageListOption threadMessageListOption 消息查询选项
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMTheadMessageListOption threadMessageListOption;
    /// // ...
    /// messageService.getThreadMessageList(
    ///     threadMessageListOption,
    ///     [](V2NIMThreadMessageListResult response) {
    ///         // do something
    ///     },
    ///     [](V2NIMError error) {
    ///         // get message list by refers failed, handle error
    ///     });
    /// @endcode
    virtual void getThreadMessageList(V2NIMTheadMessageListOption threadMessageListOption,
        V2NIMSuccessCallback<V2NIMThreadMessageListResult> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 查询 thread 聊天本地消息列表
    /// @param V2NIMMessageRefer messageRefer 消息查询选项
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMMessageRefer messageRefer;
    /// // ...
    /// messageService.getLocalThreadMessageList(
    ///     messageRefer,
    ///     [](V2NIMThreadMessageListResult response) {
    ///         // do something
    ///     },
    ///     [](V2NIMError error) {
    ///         // get message list by refers failed, handle error
    ///     });
    /// @endcode
    virtual void getLocalThreadMessageList(V2NIMMessageRefer messageRefer,
        V2NIMSuccessCallback<V2NIMThreadMessageListResult> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 删除消息
    /// @param message 需要删除的消息
    /// @param serverExtension 服务器扩展字段
    /// @param onlyDeleteLocal 是否只删除本地消息
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMMessage message;
    /// // ...
    /// messageService.deleteMessage(
    ///     message,
    ///     "serverExtension",
    ///     false,
    ///     []() {
    ///         // delete message succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // delete message failed, handle error
    ///     });
    /// @endcode
    virtual void deleteMessage(V2NIMMessage message,
        nstd::optional<nstd::string> serverExtension,
        bool onlyDeleteLocal,
        V2NIMSuccessCallback<void> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 批量删除消息
    /// @param messages 需要删除的消息列表
    /// @param serverExtension 服务器扩展字段
    /// @param onlyDeleteLocal 是否只删除本地消息
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// nstd::vector<V2NIMMessage> messages
    /// // ...
    /// messageService.deleteMessages(
    ///     messages,
    ///     "serverExtension",
    ///     false,
    ///     []() {
    ///         // delete messages succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // delete messages failed, handle error
    ///     });
    /// @endcode
    virtual void deleteMessages(nstd::vector<V2NIMMessage> messages,
        nstd::optional<nstd::string> serverExtension,
        bool onlyDeleteLocal,
        V2NIMSuccessCallback<void> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 清空历史消息
    /// @param option 清空历史消息配置选项
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMClearHistoryMessageOption option;
    /// option.conversationId = V2NIMConversationIdUtil::p2pConversationId("target_account_id");
    /// messageService.clearHistoryMessage(
    ///     option,
    ///     []() {
    ///         // clear history message succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // clear history message failed, handle error
    ///     });
    /// @endcode
    virtual void clearHistoryMessage(V2NIMClearHistoryMessageOption option, V2NIMSuccessCallback<void> success, V2NIMFailureCallback failure) = 0;

    /// @brief 更新消息本地扩展
    /// @param message 要更新的消息
    /// @param localExtension 本地扩展字段
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMMessage message;
    /// // ...
    /// messageService.updateMessageLocalExtension(
    ///     message,
    ///     "localExtension",
    ///     [](V2NIMMessage message) {
    ///         // update message local extension succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // update message local extension failed, handle error
    ///     });
    /// @endcode
    virtual void updateMessageLocalExtension(V2NIMMessage message,
        nstd::string localExtension,
        V2NIMSuccessCallback<V2NIMMessage> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 插入本地消息
    /// @param message 要插入的消息
    /// @param conversationId 会话 ID
    /// @param senderId 发送者 ID, 传空表示当前用户
    /// @param createTime 消息创建时间, 0 表示不覆盖消息时间
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// auto conversationId = V2NIMConversationIdUtil::p2pConversationId("target_account_id");
    /// auto message = V2NIMMessageCreator::createTextMessage("hello world");
    /// messageService.insertMessageToLocal(
    ///     message,
    ///     conversationId,
    ///     "target_account_id",
    ///     0,
    ///     [](V2NIMMessage message) {
    ///         // insert local message succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // insert local message failed, handle error
    ///     });
    /// @endcode
    virtual void insertMessageToLocal(V2NIMMessage message,
        nstd::string conversationId,
        nstd::string senderId,
        uint64_t createTime,
        V2NIMSuccessCallback<V2NIMMessage> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief pin 消息
    /// @param message 要 pin 的消息
    /// @param serverExtension 扩展字段
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMMessage message;
    /// // ...
    /// messageService.pinMessage(
    ///     message,
    ///     "serverExtension",
    ///     []() {
    ///         // pin message succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // pin message failed, handle error
    ///     });
    /// @endcode
    virtual void pinMessage(V2NIMMessage message,
        nstd::optional<nstd::string> serverExtension,
        V2NIMSuccessCallback<void> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 取消 pin 消息
    /// @param messageRefer 要 unpin 的消息引用
    /// @param serverExtension 扩展字段
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMMessageRefer messageRefer;
    /// // ...
    /// messageService.unpinMessage(
    ///     messageRefer,
    ///     "serverExtension",
    ///     []() {
    ///         // unpin message succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // unpin message failed, handle error
    ///     });
    /// @endcode
    virtual void unpinMessage(V2NIMMessageRefer messageRefer,
        nstd::optional<nstd::string> serverExtension,
        V2NIMSuccessCallback<void> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 更新 pin 消息
    /// @param message 要更新的 pin 消息
    /// @param serverExtension 扩展字段
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMMessage message;
    /// // ...
    /// messageService.updatePinMessage(
    ///     message,
    ///     "serverExtension",
    ///     []() {
    ///         // update pin message succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // update pin message failed, handle error
    ///     });
    /// @endcode
    virtual void updatePinMessage(V2NIMMessage message,
        nstd::optional<nstd::string> serverExtension,
        V2NIMSuccessCallback<void> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 获取 pin 消息列表
    /// @param conversationId 会话 ID
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// auto conversationId = V2NIMConversationIdUtil::p2pConversationId("target_account_id");
    /// messageService.getPinnedMessageList(
    ///     conversationId,
    ///     [](nstd::vector<V2NIMMessagePin> pins) {
    ///         for (auto&& pin : pins) {
    ///             // do something
    ///         }
    ///     },
    ///     [](V2NIMError error) {
    ///         // get pin message list failed, handle error
    ///     });
    /// @endcode
    virtual void getPinnedMessageList(nstd::string conversationId,
        V2NIMSuccessCallback<nstd::vector<V2NIMMessagePin>> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 添加快捷评论
    /// @param message 要添加快捷评论的消息
    /// @param index 快捷评论索引
    /// @param serverExtension 服务器扩展字段
    /// @param pushConfig 推送配置
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMMessage message;
    /// // ...
    /// V2NIMMessageQuickCommentPushConfig pushConfig;
    /// messageService.addQuickComment(
    ///     message,
    ///     1,
    ///     "serverExtension",
    ///     pushConfig,
    ///     []() {
    ///         // add quick comment succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // add quick comment failed, handle error
    ///     });
    /// @endcode
    virtual void addQuickComment(V2NIMMessage message,
        uint64_t index,
        nstd::optional<nstd::string> serverExtension,
        V2NIMMessageQuickCommentPushConfig pushConfig,
        V2NIMSuccessCallback<void> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 移除快捷评论
    /// @param messageRefer 要移除快捷评论的消息引用
    /// @param index 快捷评论索引
    /// @param serverExtension 服务器扩展字段
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMMessageRefer messageRefer;
    /// // ...
    /// messageService.removeQuickComment(
    ///     messageRefer,
    ///     1,
    ///     "serverExtension",
    ///     []() {
    ///         // remove quick comment succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // remove quick comment failed, handle error
    ///     });
    /// @endcode
    virtual void removeQuickComment(V2NIMMessageRefer messageRefer,
        uint32_t index,
        nstd::optional<nstd::string> serverExtension,
        V2NIMSuccessCallback<void> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 获取快捷评论列表
    /// @param messages 要获取快捷评论的消息列表
    /// @param success 成功回调, key: 消息客户端 ID, value: 快捷评论列表
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// nstd::vector<V2NIMMessage> messages
    /// // ...
    /// messageService.getQuickCommentList(
    ///     messages,
    ///     [](nstd::map<nstd::string, nstd::vector<V2NIMMessageQuickComment>> quickComments) {
    ///         for (auto&& quickComment : quickComments) {
    ///             // do something
    ///         }
    ///     },
    ///     [](V2NIMError error) {
    ///         // get quick comment list failed, handle error
    ///     });
    /// @endcode
    virtual void getQuickCommentList(nstd::vector<V2NIMMessage> messages,
        V2NIMSuccessCallback<nstd::map<nstd::string, nstd::vector<V2NIMMessageQuickComment>>> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 添加收藏
    /// @param params 添加收藏相关参数
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMAddCollectionParams params;
    /// params.collectionClientId = "id1";
    /// params.collectionType = 1;
    /// params.collectionData = "data";
    /// params.serverExtension = "serverExtension";
    /// messageService.addCollection(
    ///     params,
    ///     [](V2NIMCollection collection) {
    ///         // add collection succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // add collection failed, handle error
    ///     });
    /// @endcode
    virtual void addCollection(V2NIMAddCollectionParams params, V2NIMSuccessCallback<V2NIMCollection> success, V2NIMFailureCallback failure) = 0;

    /// @brief 移除收藏
    /// @param collections 要移除的收藏列表
    /// @param success 成功回调, 返回移除的收藏数量
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// nstd::vector<V2NIMCollection> collections;
    /// // ...
    /// messageService.removeCollections(
    ///     collections,
    ///     []() {
    ///         // remove collection succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // remove collection failed, handle error
    ///     });
    /// @endcode
    virtual void removeCollections(nstd::vector<V2NIMCollection> collections, V2NIMSuccessCallback<void> success, V2NIMFailureCallback failure) = 0;

    /// @brief 更新收藏扩展字段
    /// @param collection 要更新的收藏
    /// @param serverExtension 服务器扩展字段, 传空表示删除扩展字段
    /// @param success 成功回调, 返回更新后的收藏
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMCollection collection
    /// // ...
    /// messageService.updateCollectionExtension(
    ///     collection,
    ///     "serverExtension",
    ///     [](V2NIMCollection collection) {
    ///         // update collection succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // update collection failed, handle error
    ///     });
    /// @endcode
    virtual void updateCollectionExtension(V2NIMCollection collection,
        nstd::optional<nstd::string> serverExtension,
        V2NIMSuccessCallback<V2NIMCollection> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 分页获取收藏列表
    /// @param option 获取收藏列表查询参数
    /// @param success 成功回调, 返回收藏列表
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMCollectionOption option;
    /// option.collectionType = 1;
    /// option.limit = 10;
    /// messageService.getCollectionListByOption(
    ///     option,
    ///     [](nstd::vector<V2NIMCollection> collections) {
    ///         for (auto&& collection : collections) {
    ///             // do something
    ///         }
    ///     },
    ///     [](V2NIMError error) {
    ///         // get collection list failed, handle error
    ///     });
    /// @endcode
    virtual void getCollectionListByOption(V2NIMCollectionOption option,
        V2NIMSuccessCallback<nstd::vector<V2NIMCollection>> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 发送 P2P 消息已读回执
    /// @param message 要发送已读回执的消息
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMMessage message;
    /// // ...
    /// messageService.sendP2PMessageReceipt(
    ///     message,
    ///     []() {
    ///         // send p2p message receipt succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // send p2p message receipt failed, handle error
    ///     });
    /// @endcode
    virtual void sendP2PMessageReceipt(V2NIMMessage message, V2NIMSuccessCallback<void> success, V2NIMFailureCallback failure) = 0;

    /// @brief 查询 P2P 消息已读回执状态
    /// @param conversationId 会话 ID
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// auto conversationId = V2NIMConversationIdUtil::p2pConversationId("target_account_id");
    /// messageService.getP2PMessageReceipt(
    ///     conversationId,
    ///     [](V2NIMP2PMessageReadReceipt receipt) {
    ///         // get p2p message receipt succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // get p2p message receipt failed, handle error
    ///     });
    /// @endcode
    virtual void getP2PMessageReceipt(nstd::string conversationId,
        V2NIMSuccessCallback<V2NIMP2PMessageReadReceipt> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 查询 P2P 消息对方是否已读
    /// @param message 要查询的消息
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return bool 是否已读
    /// @par 示例代码
    /// @code
    /// V2NIMMessage message;
    /// // ...
    /// bool peerRead = messageService.isPeerRead(message);
    /// @endcode
    virtual bool isPeerRead(V2NIMMessage message) = 0;

    /// @brief 发送群消息已读回执
    /// @param messages 要发送已读回执的消息列表
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// nstd::vector<V2NIMMessage> messages;
    /// // ...
    /// messageService.sendTeamMessageReceipts(
    ///     messages,
    ///     []() {
    ///         // send team message receipts succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // send team message receipts failed, handle error
    ///     });
    /// @endcode
    virtual void sendTeamMessageReceipts(nstd::vector<V2NIMMessage> messages, V2NIMSuccessCallback<void> success, V2NIMFailureCallback failure) = 0;

    /// @brief 获取群消息已读回执状态
    /// @param messages 要查询的消息列表
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// nstd::vector<V2NIMMessage> messages;
    /// // ...
    /// messageService.getTeamMessageReceipts(
    ///     messages,
    ///     [](nstd::vector<V2NIMTeamMessageReadReceipt> receipts) {
    ///         for (auto&& receipt : receipts) {
    ///             // do something
    ///         }
    ///     },
    ///     [](V2NIMError error) {
    ///         // get team message receipts failed, handle error
    ///     });
    /// @endcode
    virtual void getTeamMessageReceipts(nstd::vector<V2NIMMessage> messages,
        V2NIMSuccessCallback<nstd::vector<V2NIMTeamMessageReadReceipt>> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 获取群消息已读回执详情
    /// @param message 要查询的消息
    /// @param memberAccountIds 指定的账号列表, 为空表示查询全部
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMMessage message;
    /// // ...
    /// messageService.getTeamMessageReceiptDetail(
    ///     message,
    ///     {},
    ///     [](V2NIMTeamMessageReadReceiptDetail readReceiptDetial) {
    ///         // get team message receipt detail succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // get team message receipt detail failed, handle error
    ///     });
    /// @endcode
    virtual void getTeamMessageReceiptDetail(V2NIMMessage message,
        nstd::set<nstd::string> memberAccountIds,
        V2NIMSuccessCallback<V2NIMTeamMessageReadReceiptDetail> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 语音转文字
    /// @param params 语音转文字参数
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMVoiceToTextParams params,
    /// params.voiceUrl = "voice_url";
    /// params.mimeType = "aac";
    /// params.duration = "1000";
    /// messageService.voiceToText(
    ///     params,
    ///     [](nstd::string text) {
    ///         // translate voice to text succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // translate voice to text failed, handle error
    ///     });
    /// @endcode
    virtual void voiceToText(V2NIMVoiceToTextParams params, V2NIMSuccessCallback<nstd::string> success, V2NIMFailureCallback failure) = 0;

    /// @brief 取消文件消息附件上传
    /// @param message 要取消上传的文件消息
    /// @param success 成功回调, 返回取消上传的文件消息
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMMessage message;
    /// // ...
    /// messageService.cancelMessageAttachmentUpload(
    ///     message,
    ///     []() {
    ///         // cancel message attachment upload succeeded
    ///     },
    ///     [](V2NIMError error) {
    ///         // cancel message attachment upload failed, handle error
    ///     });
    /// @endcode
    virtual void cancelMessageAttachmentUpload(V2NIMMessage message, V2NIMSuccessCallback<void> success, V2NIMFailureCallback failure) = 0;

    /// @brief 搜索云端消息
    /// @param params 消息检索参数
    /// @param success 成功回调
    /// @param failure 失败回调
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMMessageSearchParams params;
    /// params.keyword = "keyword";
    /// params.messageLimit = 20;
    /// messageService.searchCloudMessages(
    ///     params,
    ///     [](nstd::vector<V2NIMMessage> messages) {
    ///         for (auto&& message : messages) {
    ///             // do something
    ///         }
    ///     },
    ///     [](V2NIMError error) {
    ///         // search cloud messages failed, handle error
    ///     });
    /// @endcode
    virtual void searchCloudMessages(V2NIMMessageSearchParams params,
        V2NIMSuccessCallback<nstd::vector<V2NIMMessage>> success,
        V2NIMFailureCallback failure) = 0;

    /// @brief 添加消息监听器
    /// @param listener 监听器
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMMessageListener listener;
    /// listener.onReceiveMessages = [](nstd::vector<V2NIMMessage> messages) {
    ///     // receive messages
    /// };
    /// listener.onReceiveP2PMessageReadReceipts = [](nstd::vector<V2NIMP2PMessageReadReceipt> readReceipts) {
    ///     // receive p2p message read receipts
    /// };
    /// listener.onReceiveTeamMessageReadReceipts = [](nstd::vector<V2NIMTeamMessageReadReceipt> readReceipts) {
    ///     // receive team message read receipts
    /// };
    /// listener.onMessageRevokeNotifications = [](nstd::vector<V2NIMMessageRevokeNotification> revokeNotifications) {
    ///     // receive message revoke notifications
    /// };
    /// listener.onMessagePinNotification = [](V2NIMMessagePinNotification pinNotification) {
    ///     // receive message pin notification
    /// };
    /// listener.onMessageQuickCommentNotification = [](V2NIMMessageQuickCommentNotification quickCommentNotification) {
    ///     // receive message quick comment notification
    /// };
    /// listener.onMessageDeletedNotifications = [](nstd::vector<V2NIMMessageDeletedNotification> messageDeletedNotification) {
    ///     // receive message deleted notifications
    /// };
    /// listener.onClearHistoryNotifications = [](nstd::vector<V2NIMClearHistoryNotification> clearHistoryNotification) {
    ///     // receive clear history notifications
    /// };
    /// messageService.addMessageListener(listener);
    /// @endcode
    virtual void addMessageListener(V2NIMMessageListener listener) = 0;

    /// @brief 移除消息监听器
    /// @return void
    /// @par 示例代码
    /// @code
    /// V2NIMMessageListener listener;
    /// // ...
    /// conversationService.addMessageListener(listener);
    /// // ...
    /// messageService.removeMessageListener(listener);
    /// @endcode
    virtual void removeMessageListener(V2NIMMessageListener listener) = 0;
};
}  // namespace v2
#endif